<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored ="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>修改</title>
    <link rel="stylesheet" href="${basePath}style.css">
    <link rel="stylesheet" href="${basePath}font-awesome-4.7.0/css/font-awesome.min.css">
    <script src="https://code.jquery.com/jquery-3.6.0.min.js" type="text/javascript"></script>
    <script  src="${basePath}validation/jquery.validate.js" type="text/javascript"></script>
    <script  src="${basePath}validation/localization/messages_zh.js" type="text/javascript"></script>
    <script>
        $(function(){
            $('.editForm').validate({
                rules:{
                    courseName:"required",
                    teaName:"required"
                }
            });
        });
    </script>
</head>
<body>
<div class="add">
    <form class="editForm" action="${basePath}course?method=editsubmit" method="post">
        <input type="hidden" name="courseId" value="${course.courseId}">
        <table class="tableadd">
            <tr>
                <td>课程名称:</td>
                <td><input type="text" name="courseName" value="${course.courseName}"></td>
            </tr>
            <tr>
            <td>任课教师</td>
            <td>
                <select name="tid">
                    <option value="">请选择老师</option>
                    <c:forEach items="${teachers}" var="teacher">
                        <option
                                <c:if test="${course.teacher.tid == teacher.tid}">
                                    selected
                                </c:if>
                                value="${teacher.tid}">${teacher.teaName}</option>
                    </c:forEach>
                </select>
            </td>
            </tr>
            <tr>
                <td colspan="4" align="left" >
                    <button class="edit" onclick="window.history.back(-1);">
                        <i class="fa fa-arrow-left"></i>
                        返回
                    </button>
                    <button class="remove" type="submit">
                        <i class="fa fa-save"></i>
                        提交
                    </button>
                </td>
            </tr>
        </table>
    </form>
</div>
</body>

</html>
